package Demo2;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        //牌的初始化
        ArrayList<Card> arrayList = new ArrayList<>();
        CardOperation cardOperation = new CardOperation();
        ArrayList<Card> newList = cardOperation.InitCard(arrayList);

        //洗牌
        System.out.println(newList);
        cardOperation.changeCard(newList);
        System.out.println(newList);

        //将排分给三个人，每人5张
        ArrayList<Card> p1 = new ArrayList<>();
        ArrayList<Card> p2 = new ArrayList<>();
        ArrayList<Card> p3 = new ArrayList<>();
        ArrayList<ArrayList<Card>> people = new ArrayList<>();
        people.add(p1);
        people.add(p2);
        people.add(p3);

        //每人进行抽牌
        for (int i = 0; i < 5; i++) {
            for (int k = 0; k < 3; k++) {
                Card element = newList.remove(0);
                people.get(k).add(element);
            }
        }

        for (int j = 0; j < people.size(); j++) {
            System.out.println("第" + (j + 1) + "位选手的牌：" + people.get(j));
        }

    }
}
